package com.chinasofti.systemmonitor.controller;

import com.chinasofti.systemmonitor.dao.MonitorResult;
import com.chinasofti.systemmonitor.dao.ServerInterface;
import com.chinasofti.systemmonitor.interceptor.MainInterceptor;
import com.chinasofti.systemmonitor.validator.MainValidator;
import com.jfinal.aop.Before;
import com.jfinal.core.Controller;

/**
 * MainController
 */
@Before(MainInterceptor.class)
public class MainController extends Controller {
	
	public void index() {
		setAttr("interfaceList", ServerInterface.dao.getInterfaceList());
		setAttr("provinceList", ServerInterface.dao.getProvinceList());
		setAttr("bladeList", ServerInterface.dao.getBladeList());
		render("main.jsp");
	}
	
	@Before(MainValidator.class)
	public void getResult(){
	    renderJson(MonitorResult.dao.getResult());
	}
}


